using System;
using Randomize.Core.Generators;

namespace Randomize.Core.Descriptors
{
    public class StringDescriptor : GenerationDescriptor<string, IStringDescriptor>, IStringDescriptor
    {
        private int? _length;

        public override IGenerator<string> CreateGenerator(Random random)
        {
            return new StringGenerator(random){Length = _length, Pool = this.Pool};
        }

        public IStringDescriptor WithLength(int length)
        {
            _length = length;
            return this;
        }
    }
}